<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('审读稿件列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li class="select-time">
                            <label>缴送时间：</label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginDeliveryTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endDeliveryTime]"/>
                        </li>

                        <li>
                            <label>审读介质：</label>
                            <select name="mediumSuper" th:with="type=${@dict.getType('review_manuscript_media')}">
                                <option value="">--所有--</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <!-- <li>
                            <label>审读介质子分类：</label>
                            <input type="text" name="mediumSub"/>
                        </li> -->
                        <li>
                            <label>审读专家：</label>
                            <input type="text" name="expertName"/>
                        </li>

                        <li>
                            <label>出版单位：</label>
                            <input type="text" name="publisher"/>
                        </li>

                        <li>
                            <label>题材内容：</label>
                            <select name="subjectContent" th:with="type=${@dict.getType('manuscript_theme')}">
                                <option value="">--所有--</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <label>稿件倾向：</label>
                            <select name="inclination" th:with="type=${@dict.getType('manuscript_tropesis')}">
                                <option value="">--所有--</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <!-- <li>
                            <label>备用字段：</label>
                            <input type="text" name="ex1"/>
                        </li>
                        <li>
                            <label>备用字段：</label>
                            <input type="text" name="ex5"/>
                        </li> -->
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="publish:review:add" >
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.editTab()"
               shiro:hasPermission="publish:review:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
<!--            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"-->
<!--               shiro:hasPermission="publish:review:remove">-->
<!--                <i class="fa fa-remove"></i> 删除-->
<!--            </a>-->
            <a class="btn btn-warning" onclick="$.table.exportExcelRecord('formId')" shiro:hasPermission="publish:review:export" >
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('publish:review:edit')}]];
    var removeFlag = [[${@permission.hasPermi('publish:review:remove')}]];
    var subjectContentDatas = [[${@dict.getType('manuscript_theme')}]];
    var formDatas = [[${@dict.getType('manuscript_form')}]];
    var inclinationDatas = [[${@dict.getType('manuscript_tropesis')}]];
    var adoptionDatas = [[${@dict.getType('manuscript_use')}]];
    var sourceDatas = [[${@dict.getType('manuscript_source')}]];
    var prefix = ctx + "publish/review";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            detailUrl: prefix + "/detail/{id}",
            sortName: "createTime",
            sortOrder: "desc",
            modalName: "审读稿件",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                {
                    field: 'index',
                    align: 'center',
                    title: "序号",
                    formatter: function (value, row, index) {
                        var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                        return columnIndex + $.table.serialNumber(index);
                    }
                },
                {
                    field: 'publisher',
                    title: '出版单位',
                    sortable: true,
                },
                {
                    field: 'subjectContent',
                    title: '题材内容',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(subjectContentDatas, value);
                    },
                    sortable: true,
                },
                {
                    field: 'mediumSuper',
                    title: '审读介质',
                    sortable: true,
                },
                {
                    field: 'deliveryTime',
                    title: '缴送时间',
                    sortable: true,
                },
                {
                    field: 'expertName',
                    title: '审读专家名',
                    sortable: true,
                },
                {
                    field: 'inclination',
                    title: '稿件倾向',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(inclinationDatas, value);
                    },
                    sortable: true,
                },
                {
                    field: 'submitDate',
                    title: '提交时间',
                    sortable: true,
                },
                // {
                //     field: 'form',
                //     title: '稿件形式',
                //     formatter: function (value, row, index) {
                //         return $.table.selectDictLabel(formDatas, value);
                //     }
                // },
                // {
                //     field: 'cost',
                //     title: '稿件费用'
                // },
                // {
                //     field: 'adoption',
                //     title: '采用情况',
                //     formatter: function (value, row, index) {
                //         return $.table.selectDictLabel(adoptionDatas, value);
                //     }
                // },
                // {
                //     field: 'source',
                //     title: '稿件来源',
                //     formatter: function (value, row, index) {
                //         return $.table.selectDictLabel(sourceDatas, value);
                //     }
                // },
                // {
                //     field: 'reviewDesc',
                //     title: '说明'
                // },
                // {
                //     field: 'reviewContent',
                //     title: '稿件内容'
                // },
                // {
                //     field: 'otherDesc',
                //     title: '其它说明'
                // },
                // {
                //     field: 'append',
                //     title: '附件'
                // },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        actions.push('<a style="margin-left:3px" class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.id + '\')"><i class="fa fa-book"></i>查看</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>